#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016-2018, Niklas Hauser
# Copyright (c) 2017, Fabian Greif
#
# This file is part of the modm project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# -----------------------------------------------------------------------------

def init(module):
    module.name = ":math"
    module.description = "Math"

def prepare(module, options):
    module.depends(":math:units")
    return True

def build(env):
    env.outbasepath = "modm/src/modm/math"
    env.copy("tolerance.hpp")

    env.outbasepath = "modm/src/modm"
    headers = env.generated_local_files(filterfunc=lambda path: ".h" in path and not "_impl.h" in path)
    env.template("math.hpp.in", substitutions={"headers": sorted(headers)})
